package org.example.ychdp.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * seat
 * @author 
 */
public class Seat implements Serializable {
    /**
     * 座位的唯一标识符
     */
    private Integer seatid;

    /**
     * 关联票务ID，表明该座位属于哪类票务对应的座位
     */
    private Integer ticketid;

    /**
     * 座位号，如“3排5号”等具体表示形式
     */
    private String seatnumber;

    /**
     * 是否可用，1表示可用，0表示已售出或不可用
     */
    private Boolean isavailable;

    /**
     * 座位所在排数
     */
    private Integer seatrow;

    /**
     * 座位所在列数（若有需要更精确座位定位）
     */
    private Integer seatcolumn;

    /**
     * 座位所在区域，例如内场、看台A区等
     */
    private String seatarea;

    /**
     * 该座位的实际售价（可能与对应票档价格有差异）
     */
    private BigDecimal price;

    /**
     * 记录当前选择该座位的用户ID
     */
    private Integer userid;

    /**
     * 座位被选中的时间，便于判断超时未支付等情况
     */
    private Date selectedtime;

    private static final long serialVersionUID = 1L;

    public Integer getSeatid() {
        return seatid;
    }

    public void setSeatid(Integer seatid) {
        this.seatid = seatid;
    }

    public Integer getTicketid() {
        return ticketid;
    }

    public void setTicketid(Integer ticketid) {
        this.ticketid = ticketid;
    }

    public String getSeatnumber() {
        return seatnumber;
    }

    public void setSeatnumber(String seatnumber) {
        this.seatnumber = seatnumber;
    }

    public Boolean getIsavailable() {
        return isavailable;
    }

    public void setIsavailable(Boolean isavailable) {
        this.isavailable = isavailable;
    }

    public Integer getSeatrow() {
        return seatrow;
    }

    public void setSeatrow(Integer seatrow) {
        this.seatrow = seatrow;
    }

    public Integer getSeatcolumn() {
        return seatcolumn;
    }

    public void setSeatcolumn(Integer seatcolumn) {
        this.seatcolumn = seatcolumn;
    }

    public String getSeatarea() {
        return seatarea;
    }

    public void setSeatarea(String seatarea) {
        this.seatarea = seatarea;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public Date getSelectedtime() {
        return selectedtime;
    }

    public void setSelectedtime(Date selectedtime) {
        this.selectedtime = selectedtime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Seat other = (Seat) that;
        return (this.getSeatid() == null ? other.getSeatid() == null : this.getSeatid().equals(other.getSeatid()))
            && (this.getTicketid() == null ? other.getTicketid() == null : this.getTicketid().equals(other.getTicketid()))
            && (this.getSeatnumber() == null ? other.getSeatnumber() == null : this.getSeatnumber().equals(other.getSeatnumber()))
            && (this.getIsavailable() == null ? other.getIsavailable() == null : this.getIsavailable().equals(other.getIsavailable()))
            && (this.getSeatrow() == null ? other.getSeatrow() == null : this.getSeatrow().equals(other.getSeatrow()))
            && (this.getSeatcolumn() == null ? other.getSeatcolumn() == null : this.getSeatcolumn().equals(other.getSeatcolumn()))
            && (this.getSeatarea() == null ? other.getSeatarea() == null : this.getSeatarea().equals(other.getSeatarea()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getSelectedtime() == null ? other.getSelectedtime() == null : this.getSelectedtime().equals(other.getSelectedtime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSeatid() == null) ? 0 : getSeatid().hashCode());
        result = prime * result + ((getTicketid() == null) ? 0 : getTicketid().hashCode());
        result = prime * result + ((getSeatnumber() == null) ? 0 : getSeatnumber().hashCode());
        result = prime * result + ((getIsavailable() == null) ? 0 : getIsavailable().hashCode());
        result = prime * result + ((getSeatrow() == null) ? 0 : getSeatrow().hashCode());
        result = prime * result + ((getSeatcolumn() == null) ? 0 : getSeatcolumn().hashCode());
        result = prime * result + ((getSeatarea() == null) ? 0 : getSeatarea().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getSelectedtime() == null) ? 0 : getSelectedtime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", seatid=").append(seatid);
        sb.append(", ticketid=").append(ticketid);
        sb.append(", seatnumber=").append(seatnumber);
        sb.append(", isavailable=").append(isavailable);
        sb.append(", seatrow=").append(seatrow);
        sb.append(", seatcolumn=").append(seatcolumn);
        sb.append(", seatarea=").append(seatarea);
        sb.append(", price=").append(price);
        sb.append(", userid=").append(userid);
        sb.append(", selectedtime=").append(selectedtime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}